{extend name="public:layout" /}
{block name="title"}添加优惠券{/block}
{block name="head"}{/block}
{block name="body"}
<div class="wrapper wrapper-content animated fadeInRight">
	<div class="ibox">
		<div class="ibox-title">
			<ol class="breadcrumb">
				<li><i class="fa fa-hand-o-right"></i> <a href="{:url('index')}"> 优惠券列表</a></li>
				<li class="active">修改优惠券</li>
			</ol>
		</div>
		<div class="ibox-content">
			<form method="post" class="form-horizontal" id="form">
				<div class="form-group">
					<label class="col-sm-2 control-label Validform_label">优惠券标题</label>
					<div class="col-sm-8">
						<input type="text" class="form-control" datatype="*" name="title" value="{$info.title}"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label Validform_label">副标题</label>
					<div class="col-sm-8">
						<input type="text" class="form-control" datatype="*" name="sub_title" value="{$info.sub_title}"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label Validform_label">代金券图片</label>
					<div class="col-sm-8">
						{:widget('common/Form/singleImg',['card_image',$info['card_image'],$uid])}
					</div>
				</div>
                {eq name="info.date_type" value="DATE_TYPE_FIX_TIME_RANGE"}
				<div class="DATE_TYPE_FIX_TIME_RANGE date-type">
					<div class="form-group">
						<label class="col-sm-2 control-label Validform_label">开始日期</label>
						<div class="col-sm-4">
							<input type="text" class="form-control laydate" name="begin_timestamp" value="{$info.begin_timestamp|date='Y-m-d H:i:s',###}" />
							<p class="help-block">该优惠卷生效日期</p>
						</div>
						<label class="col-sm-2 control-label Validform_label">结束日期</label>
						<div class="col-sm-4">
							<input type="text" class="form-control laydate" name="end_timestamp" value="{$info.end_timestamp|date='Y-m-d H:i:s',###}" />
							<p class="help-block">该优惠卷失效日期</p>
						</div>
                        <script>laydate.render({elem: '.laydate'});</script>
					</div>
				</div>
                {/eq}
                {eq name="info.date_type" value="DATE_TYPE_FIX_TERM"}
				<div class="DATE_TYPE_FIX_TERM date-type">
					<div class="form-group">
						<label class="col-sm-2 control-label Validform_label">多少天后生效</label>
						<div class="col-sm-4">
							<input class="form-control" name="fixed_begin_term" value="{$info.fixed_begin_term}" type="text" />
							<p class="help-block">表示自领取后多少天后开始生效，领取后当天生效填写0</p>
						</div>
						<label class="col-sm-2 control-label Validform_label">有效天数</label>
						<div class="col-sm-4">
							<input class="form-control" name="fixed_term" value="{$info.fixed_term}" type="text" />
							<p class="help-block">表示自生效后多少天内有效，不支持填写0</p>
						</div>
					</div>
				</div>
                {/eq}
				<div class="form-group">
					<label class="col-sm-2 control-label Validform_label">代金券面额</label>

					<div class="col-sm-4">
						<input class="form-control" name="card_money" value="{$info.card_money}" datatype="*" type="text"/>
						<p class="help-block">代金券金额</p>
					</div>
					<label class="col-sm-2 control-label Validform_label">订单金额</label>

					<div class="col-sm-4">
						<input class="form-control" name="card_order_money" value="{$info.card_order_money}" type="text"/>
						<p class="help-block">满足该订单金额才可使用,不限制请填0</p>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label Validform_label">购买金额</label>

					<div class="col-sm-4">
						<input class="form-control" name="sale_money" value="{$info.sale_money}" type="text"/>
						<p class="help-block">勾选在线购买该金额生效</p>
					</div>
					<label class="col-sm-2 control-label Validform_label">库存</label>

					<div class="col-sm-4">
						<input class="form-control" name="quantity" value="{$info.quantity}" type="text" datatype="n"/>
						<p class="help-block">库存0表示不限制发放数量</p>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label Validform_label">使用说明</label>
					<div class="col-sm-10">
						<textarea class="form-control" rows="5" name="direction">{$info.direction}</textarea>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-10 col-sm-offset-2">
						<button class="btn btn-primary" type="button" id="btnSub">确 认</button>
						<a href="{:url('index')}" class="btn btn-white">取消</a>
						<span id="validError"></span>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    $(function () {
        iCheck();
        ajaxSubForm('#btnSub');
    })
</script>
{/block}